﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace Steam_Backup
{
    public partial class FrmOptions : Form
    {
        private Settings m_settings = new Settings();
        private string m_szBackupsFolder = string.Empty;

        public FrmOptions(Settings a_settings)
        {
            InitializeComponent();
            m_settings = a_settings;
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            m_settings.BackupLocation = txtBackupLocation.Text;
            m_settings.SteamLocation = txtSteamLocation.Text;
        }

        private void FrmOptions_Load(object sender, EventArgs e)
        {
            txtSteamLocation.Text = m_settings.SteamLocation.Equals(string.Empty) ? Utilities.GetSteamPath() : m_settings.SteamLocation;
            txtBackupLocation.Text = m_settings.BackupLocation.Equals(string.Empty) ? Path.Combine(Utilities.GetSteamPath(), m_szBackupsFolder) : m_settings.BackupLocation;
        }
    }
}
